class Solution {
public:
    void moveZeroes(vector<int>& nums)
    {

        int cur = 0;
        int dest = -1;

        while (cur < nums.size())
        {
            if (nums[cur] != 0)
            {
                swap(nums[cur++], nums[++dest]);
            }
            else
            {
                cur++;
            }
        }

    }
};